package com.open.cloud.rbac.controller.application;

import com.inspur.micro.core.response.ResponseWrapper;
import com.open.cloud.rbac.entity.application.CoreApplicationModule;
import com.open.cloud.rbac.service.application.ICoreApplicationModuleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 应用模块表 前端控制器
 * </p>
 *
 * @author wangzengzhou01
 * @since 2024-12-23
 */
@Api(tags = "RBAC服务-应用模块业务")
@Slf4j
@RestController
@RequestMapping(value = "api/v1/core/application/module")
public class CoreApplicationModuleController {

    @Resource
    private ICoreApplicationModuleService applicationModuleService;

    @ApiOperation(value = "列表查询")
    @GetMapping("/list")
    public ResponseWrapper<List<CoreApplicationModule>> getModuleList(@RequestParam(name = "appId",required = false) String appId) {
        List<CoreApplicationModule> data = applicationModuleService.getAppModuleByAppId(appId);
        return ResponseWrapper.success(data);
    }

}

